FROM mcr.microsoft.com/dotnet/sdk:7.0 AS BUILD-ENV
WORKDIR /src
COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release -o /app

FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /app
COPY --from=BUILD-ENV /app .
EXPOSE 80
ENTRYPOINT [ "dotnet", "StudentManagerAPI.dll" ]